package cn.dengta.webapp.user.entity;

import java.util.Date;

import cn.dengta.common.util.Formats;
import cn.dengta.webapp.base.entity.BaseEntity;
import com.baomidou.mybatisplus.annotation.TableName;
import lombok.Getter;
import lombok.Setter;

/**
 * 万圣节统计
 */
@Getter
@Setter
@TableName("act_halloween_count")
public class ActHalloweenCount extends BaseEntity {

	/** 统计日期 */
	private Date period;
	/** 浏览量 */
	private Integer click;
	/** 参与人数 */
	private Integer goIn;
	/** 充值人数 */
	private Integer recharge;
	/** 兑换头饰人数 */
	private Integer tire;
	/** 兑换视频卡人数 */
	private Integer video;
	/** 兑换VIP人数 */
	private Integer vip;

	public static final String CLICK = "click";
	public static final String GOIN = "go_in";
	public static final String RECHARGE = "recharge";
	public static final String TIRET = "tire";
	public static final String VIDEO = "video";
	public static final String VIP = "vip";

	public void switchField(String field) {
		switch (field) {
			case CLICK:
				this.setClick(1);
				break;
			case GOIN:
				this.setGoIn(1);
				break;
			case RECHARGE:
				this.setRecharge(1);
				break;
			case TIRET:
				this.setTire(1);
				break;
			case VIDEO:
				this.setVideo(1);
				break;
			case VIP:
				this.setVip(1);
				break;
		}
	}

	public String getPeriod_() {
		return Formats.formatDate_D(period);
	}


	@Getter
	@Setter
	public static class GoIn{
		private Date period;
		private Integer goIn;
	}
}
